<?php
class defaultController{
	//属性
	protected $tempmodel;
	//方法
	public function __construct(){
		//创建model
		//加载model文件
		//项目复杂的时候 加载php文件使用绝对路径
		include("./models/defaultmodel.class.php");
		$this->tempmodel=new defaultModel("localhost:3306","root","root","jianli");
	}
	public function __destruct(){

	}
	//控制器负责协调手页面的model以及view
	public function index(){
		//index方法对应的是index.php入口文件
		//协调主界面的model以及主界面的view
		
		//model
		//model所提供的数据view是怎么使用的?
		//对象的形式  数组的实行
		// $testarray=array("username"=>"李盛华","bieming"=>"Listen","xuanyan"=>"好好学习，天天向上");

		//加载首页面显示的内容($testarray)
		$testarray=$this->tempmodel->getallinfos("115333530330");
		//加载首页面导航($daohang)
		//下面是模拟数据
		 // $daohang=array("shouye"=>"","xuanyan"=>"?f=gerenxuanyan","jiben"=>"?f=jibenziliao","xiangxi"=>"?f=xiangxiziliao","qiuzhi"=>"?f=qiuzhiyixiang","jiaoyu"=>"?f=jiaoyujingli","gongzuo"=>"?f=gongzuojingli","zizhi"=>"?f=zizhizhengshu","lianxi"=>"?f=lianxifangshi");
		// 下面是导航真实数据
		$daohang=$this->tempmodel->getdaohanginfos();
		//  foreach ($daohang as $key => $value) {
		// 	echo $key.":".$value."<br/>";
		//  }
		// view
		include("./views/index.htm.php");
		//PHP里的include 做代码展开的
	}
     
    /**
     * 该方法用来控制个人宣言界面的model和view
     */
    public function gerenxuanyan(){
    	//构造个人宣言model
    	$xuanyanarray=$this->tempmodel->getgerenxuanyan("115333530330");
    	$daohang=$this->tempmodel->getdaohanginfos();
    	//构造个人宣言view
    	include("./views/jobpage002.htm.php");
    }

	public function jibenziliao(){
		//构造基本资料model
		$testarray=$this->tempmodel->getallinfos("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造基本资料view
		include("./views/jobpage003.htm.php");
	}

	public function xiangxiziliao(){
		//构造详细资料model
		$xiangxiarray=$this->tempmodel->getxiangxiziliao("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造详细资料view
		include("./views/jobpage004.htm.php");
	}

	public function qiuzhiyixiang(){
		//构造求职意向model
		$qiuzhiarray=$this->tempmodel->getqiuzhiyixiang("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造求职意向view
		include("./views/jobpage005.htm.php");
	}

	public function jiaoyujingli(){
		//构造教育经历model
		$jiaoyuarray=$this->tempmodel->getjiaoyujingli("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造教育经历view
		include("./views/jobpage006.htm.php");
	}

	public function gongzuojingli(){
		//构造工作经历model
		$gongzuoarray=$this->tempmodel->getgongzuojingli("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造工作经历view
		include("./views/jobpage007.htm.php");
	}

	public function zizhizhengshu(){
		//构造资质证书model
		$zhengshuarray=$this->tempmodel->getzizhizhengshu("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//构造资质证书view
		include("./views/jobpage008.htm.php");
	}

	public function lianxifangshi(){
		//联系方式model
		$lianxiarray=$this->tempmodel->getlianxifangshi("115333530330");
		$daohang=$this->tempmodel->getdaohanginfos();
		//联系方式view
		include("./views/jobpage009.htm.php");
	}
}
?>